
const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
    app.use(createProxyMiddleware('/api', {
        target:'http://192.168.2.236:8770/',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
            "^/api": ""
        }
    }));
    app.use(createProxyMiddleware('/api2', {
        target:'http://192.168.2.224:8768/',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
            "^/api2": ""
        }
    }));
    app.use(createProxyMiddleware('/api3', {
        target:'http://192.168.2.236:8764/',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
            "^/api3": ""
        }
    }));
    app.use(createProxyMiddleware('/api4', {
        target:'http://192.168.2.146:8766/',
        secure: false,
        changeOrigin: true,
        pathRewrite: {
            "^/api": ""
        }
    }));
};